<?php

require_once 'PHPUnit/Framework.php';
require_once('TVB/PWORKS/util/CommonUtil.class.php');

class EpisodeAddActionTest extends PHPUnit_Framework_TestCase
{
	public static $programme_id = 291;

	protected function setUp()
	{
		$this->url = "http://pdes.tvb.com/episode_step1.html?act=add&step=2&ut=true";
	}

	protected function tearDown()
	{
		$this->url = NULL;
	}

	public function testSuccess(){

		$post_data = array(
			//-- add record{{{
			'programme_id' => self::$programme_id, 
			'onair_episode_no' => '2004',
			'programme_title_cn' => 'dfdfas',
			'programme_title_en' => 'vanni0710_path',
			'programme_path' => 'vanni0710_path',
			'pt' => 1
			//}}}
		);

		$ret = CommonUtil::curl_test($this->url,$post_data);
		$real_data = json_decode($ret);
		$err_num = count($real_data);
		if ($err_num == 0)
		{
			echo "EpisodeAddActionTest pass!<br>";
		}

		$this->assertEquals($err_num, 0); 	
	}
}

//$suite = new PHPUnit_Framework_TestSuite('EpisodeAddActionTest');

// Run the tests
//$object = $suite->run();
//var_dump($object->failures());

?>


